package com.varian.security.authorization;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.Transient;
import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken;

import java.util.Collection;
import java.util.Map;

/**
 * @author ben
 * @since 2024/7/31
 */
@Transient
public class VarianJwtAuthenticationToken extends AbstractOAuth2TokenAuthenticationToken<Jwt> {

    protected VarianJwtAuthenticationToken(Jwt token, Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
        super(token, principal, credentials, authorities);
        setAuthenticated(true);
    }

    @Override
    public Map<String, Object> getTokenAttributes() {
        return Map.of();
    }

}
